import { Base } from '../../utils/base.js';

class Classify extends Base {
  constructor() {
    var url = Base.baseurl;
    super();//调用基类的构造函数，必须，否则报错
  }
  //获取一级分类
  top_class(callBakes) {
    var params = {
      url: 'index/Defaults/index',
      callBake: function (res) {
        callBakes(res);
      }
    }
    this.requset(params);
  }
  //获取二级分类
  classList(callBakes, parent_id) {
    var params = {
      url: 'index/Defaults/searchgoods?cat_id=' + parent_id,
      callBake: function (res) {
        callBakes(res);
      }
    }
    this.requset(params);
  }



  //下拉刷新接口
  getpushdownapi(callBakes) {
    var params = {
      url: 'index/Defaults/getAllGodds',
      callBake: function (res) {
        callBakes(res);
      }
    }
    this.requset(params);
  }
  //上拉加载
  getMoregoodsAllList(callBakes, pages) {
    var params = {
      url: 'index/Defaults/getAllGodds?page=' + pages,
      callBake: function (res) {
        callBakes(res);
      }
    }
    this.requset(params);
  }
}
export { Classify };